machine: enter target PID namespace when adding a live mount
authorLuca Boccassi <bluca@debian.org>
Wed, 13 Jan 2021 23:52:00 +0000 (23:52 +0000)
committerAdrian Bunk <bunk@debian.org>
Sun, 25 Aug 2024 19:05:15 +0000 (22:05 +0300)
commit4ea9f4c9b8afe34bf774c816eb830e93d85b1d17
tree2c6a3e47aed2cc2bb0a8090024b63f45da56b415
parent922d453b3f295757d22267de44fced8f9d0326d3
machine: enter target PID namespace when adding a live mount

machinectl fails since 21935150a0c42b91a322105f6a9129116bfc8e2e as it's now
mounting onto a file descriptor in a target namespace, without joining the
target's PID namespace.
Note that it's not enough to setns CLONE_NEWPID, but a double-fork is required
as well, as implemented by namespace_fork().

Add a test case to TEST-13-NSPAWN to cover this use case.

(cherry picked from commit 98f654fdeab1e1b6df2be76e29e4ccbb6624898d)

Gbp-Pq: Name machine-enter-target-PID-namespace-when-adding-a-live-mou.patch
src/shared/mount-util.c
test/create-busybox-container
test/units/testsuite-13.sh